﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data;
using System.Data.SqlClient;
public partial class DemoGridView_ProductDetail : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            string id = Request.QueryString["id"];
            loaddata(id);
        }
    }
    private void loaddata(string masach)
    {
        SqlCommand cmd = DataAccess.Connection.CreateCommand();
        cmd.CommandText = "select * from product where Pid='" + masach + "'";
        //cmd.CommandType = CommandType.Text;
        SqlDataReader dr = cmd.ExecuteReader();
        if (dr.HasRows)
        {
            if (dr.Read())
            {
                Image1.ImageUrl = "~/images/"+dr["picture"].ToString();
                lbltensp.Text = dr["pname"].ToString();
                lblsize.Text = dr["size"].ToString();
                lblgia.Text = dr["price"].ToString();
                lbllang.Text = dr["lang"].ToString(); ;
                lblmota.Text = dr["describe"].ToString(); ;
            }
        }
    }

}
